package cn.minhx.domain.activity.model.valobj;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 折扣优惠类型
 *
 * @author min
 */
@Getter
@AllArgsConstructor
public enum DiscountTypeEnum {
	BASE(0, "基础优惠"), TAG(1, "人群标签"),;

	private final Integer code;
	private final String info;

	public static DiscountTypeEnum get(Integer code) {
		return switch (code) {
			case 0 -> BASE;
			case 1 -> TAG;
			default -> throw new RuntimeException("err discount_type code!");
		};
	}
}
